import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';

//打开设置弹窗
Widget OpenAppSettingWidget({String? str}) {
  return Material(
    color: Colors.transparent,
    child: CupertinoAlertDialog(
      title: const Center(
        child: Text("提示"),
      ),
      content: Center(
        child: Text(str ?? ""),
      ),
      actions: [
        CupertinoButton(
            child: const Text("取消"),
            onPressed: () {
              Get.back();
            }),
        CupertinoButton(
            child: const Text("确认"),
            onPressed: () {
              Get.back();
              openAppSettings();
            })
      ],
    ),
  );
}
